
#ifndef __COORD_CONVERT_H__
#define __COORD_CONVERT_H__

/**
 * @file
 * @brief Define the coordinate_conversion class.
 */

#pragma once

#include "common/cgal_def.h"
#include "common/vec2d.h"

#include <string>
#include <vector>

#include <opencv2/opencv.hpp>

using namespace global_path_planner::common;

/**
 * @namespace global_path_planner::ccpp
 * @brief global_path_planner::ccpp
 */
namespace global_path_planner {
namespace ccpp {

/**
 * @class CoordConvert
 * @brief The class of CoordConvert in 2-D.
 */
class CoordConvert {
public:
    /**
     * @brief Empty constructor.
     */
    explicit CoordConvert();
    virtual ~CoordConvert();
    // 轮廓顶点转化为实际值
    std::pair<float, float> Point_2ToReal(Point_2& point_2, float& resolution, 
                                        double& origin_x, double& origin_y, 
                                        uint32_t height = 0);

    std::vector<std::pair<float, float>> Point_2sToReals(std::vector<Point_2>& p2_pts, float& resolution, 
                                                        double& origin_x, double& origin_y, uint32_t height = 0);

    // 像素转化为实际值
    std::pair<float, float> cvPoint2Real(cv::Point& cv_point, float& resolution, 
                                        double& origin_x, double& origin_y, 
                                        uint32_t height = 0);

    std::vector<std::pair<float, float>> cvPoints2Reals(std::vector<cv::Point>& cv_points, float& resolution, 
                                                        double& origin_x, double& origin_y, uint32_t height = 0);

    // Vec2d转化为实际值
    std::pair<float, float> Vec2dToReal(Vec2d& vec2d, float& resolution, 
                                        double& origin_x, double& origin_y, 
                                        uint32_t height = 0);

    std::vector<std::pair<float, float>> Vec2dsToReals(std::vector<Vec2d>& vec2ds, float& resolution, 
                                                    double& origin_x, double& origin_y, uint32_t height = 0);

};
}  // namespace ccpp
}  // namespace global_plan_path

#endif  // __COORD_CONVERT_H__
